Component({
    properties: {
        lists:{ type: Array },
        title: { type: String },
    },
    data: {
        //
        imgs:{
            toastClose: '/assets/img/close_icon.png',
            unSel: '/assets/img/unselect.png',
            seled: '/assets/img/selected.png',

        },
        bp:null,
        currentId: null,
    },
    methods: {
        _closeToast(data){
            data["ty"] = this.data.title;
            this.triggerEvent("closeToast", data);
        },
        deviceInfo(){
            let info= wx.getSystemInfoSync();
            this.setData({
                bp: info.statusBarHeight == 20 ? "0rpx": "68rpx",
            })
        },
        clickItem(e){
            let idx = e.currentTarget.dataset.id;
            this.setData({
                currentId: idx
            })
            this._closeToast(this.data.lists[idx])
        }
    },
    attached() {
        this.deviceInfo();
    }
});
